Repository navigation
fix(ci): report the commit a pinned maintenance checkout builds - #5556
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Why Woodpecker starts a manual pipeline at main's tip, and the config extension checks out the request's declared verified source (`CI_MAINTENANCE_SOURCE`, `CI_EXTENDED_SOURCE`) in its place. Every command still saw Woodpecker's `CI_COMMIT_SHA`, the tip. Maintenance pipeline #21090 cloned 133b052 (the coordinator's verified source, #5545) while its bootstrap diagnostic, `toolkit ci maintenance` and any image pin reported e8471e9 (#5538). The current ci-base and ci-playwright pins record sourceCommit f69a23f although #19963 built e192613. Push and pull-request pipelines never differed. What - Every emitted command container sets `CI_COMMIT_SHA` to the commit its workflow checks out. Step environment overrides Woodpecker's metadata, so builds, pins and diagnostics name the built commit. Push and PR values are unchanged because their checkout commit is Woodpecker's. - The source-cache clone keeps Woodpecker's value and fails unless its commit is that `CI_COMMIT_SHA` or a declared request source. - `toolkit ci maintenance` reports the declared source a run built as `source`, and Woodpecker's tip as `woodpeckerCommit`. Verification - New tests: the clone check (`test/checkout/declared.test.ts`), a #21090 replay through the signed HTTP app, every emitted command's `CI_COMMIT_SHA`, and the toolkit's reported source. The extension tests fail without the environment change. - `bunx turbo run typecheck lint test` for the extension and toolkit, root `jscpd quality-ratchet knip`, and `bunx lefthook run pre-commit` pass. - Not run: a live maintenance pipeline on the new extension image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
071fa3a to
544ccf8
Compare
|
@codex review Automated re-review request for |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why Restacking onto #5556 brought a new emit test that calls cacheSourceSteps without the `main` input this branch made required, so typecheck failed. What - The test now passes `main: true` for its trusted cached steps. #5556's assertDeclaredCheckout and this branch's tier and commit-lock setup are both kept in checkout/main.ts after resolving the restack conflict. Verification - bunx turbo run build typecheck test lint for the extension and @homelab/cdk8s: 40/40 tasks; extension 504 passed, 1 skipped (the Linux-only flock test on macOS); cdk8s 3194 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why Restacking onto #5556 brought a new emit test that calls cacheSourceSteps without the `main` input this branch made required, so typecheck failed. What - The test now passes `main: true` for its trusted cached steps. #5556's assertDeclaredCheckout and this branch's tier and commit-lock setup are both kept in checkout/main.ts after resolving the restack conflict. Verification - bunx turbo run build typecheck test lint for the extension and @homelab/cdk8s: 40/40 tasks; extension 504 passed, 1 skipped (the Linux-only flock test on macOS); cdk8s 3194 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
Maintenance pipeline #21090 checked out and built 133b052 (#5545), but its steps reported
CI_COMMIT_SHAe8471e9 (#5538). The cause is not a stale cache. Woodpecker 3.20's manual pipeline API takes only a branch (PipelineOptions{branch, variables}), soCreatePipelinestarts at main's tip fromBranchHead. The coordinator then declares the newest verified main inCI_MAINTENANCE_SOURCE. The config extension (sourcePinnedEmitter→maintenanceSourcePipeline) checks out that verified commit in place of the tip, as designed. Woodpecker's record and every step'sCI_COMMIT_SHAstill named the tip, so the bootstrap diagnostic, image pins andtoolkit ci maintenanceall reported a commit that was never built.For #21090, #5538 merged at 06:12:24Z. The coordinator submitted source 133b052 at 06:12:47.66Z, because push #21044 was the newest green main. Woodpecker created #21090 at the new tip, e8471e9, at 06:12:48Z.
Push and pull-request pipelines are not affected. Every pinned maintenance run is: the current
ci/ci-image/STATE.jsonandci/ci-playwright/STATE.jsonrecordsourceCommitf69a23f, but #19963 built e192613.What
CI_COMMIT_SHAto the commit its workflow checks out. Woodpecker applies step environment after its metadata, so this value wins. Push and PR values do not change, because their checkout commit is already Woodpecker's.CI_COMMIT_SHAand fails unless the commit it was given is that value or the signed request's declaredCI_MAINTENANCE_SOURCE/CI_EXTENDED_SOURCE(src/checkout/declared.ts). It already assertedHEADequals that commit.toolkit ci maintenancenow reports the declared source assourceand Woodpecker's tip aswoodpeckerCommit.Demo
Before: live #21090 evidence.
After: #21090's request replayed through this branch's emitter and clone check.
Scope: each clone step's
CI_CHECKOUT_DIAGNOSTIC.sourceShacompared with Woodpecker's commit (CI_COMMIT_SHA).Verification
test/checkout/declared.test.tscovers the clone check.authorization-http.test.ts).CI_COMMIT_SHA(emit.test.ts).test/lib/ci/maintenance.test.ts).main's emitter.bunx turbo run typecheck lint test --filter=@shepherdjerred/woodpecker-config-extension --filter=@shepherdjerred/toolkitpassed: 37/37 tasks, 492 extension tests.bunx turbo run jscpd quality-ratchet knip --filter=//passed: 18/18.bunx lefthook run pre-commitpassed.bunx turbo run test:extended --filter='...[origin/main...HEAD]' --continuepassed: 53/53 tasks across 8 affected packages, including@shepherdjerred/temporaland@shepherdjerred/toolkittest:extended.AI-1219: Woodpecker's own pipeline record and the GitHub status it posts still name main's tip, because the 3.20 manual API cannot start at a commit.🤖 Generated with Claude Code